Skip to content

Commit 8de33b7

Browse files
authoredFeb 5, 2025
refactor: change methods not using its bound instance to staticmethods (#26)
2 parents 78b74ab + d7c8f41 commit 8de33b7

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed
 

‎nonebot_plugin_genshin_cos/hoyospider.py

+4-2
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,8 @@ async def async_name(self, params: dict, is_good: bool = False):
143143
response = await client.get(self.api, params=params, headers=self.headers)
144144
return self.get_rsp_name(response, is_good)
145145

146-
def handle_response(self, response: Response, is_good: bool = False) -> list:
146+
@staticmethod
147+
def handle_response(response: Response, is_good: bool = False) -> list:
147148
"""
148149
处理响应
149150
@@ -161,7 +162,8 @@ def handle_response(self, response: Response, is_good: bool = False) -> list:
161162

162163
return [image for post in posts for image in post["post"]["images"]]
163164

164-
def get_rsp_name(self, response: Response, is_good: bool = False) -> list:
165+
@staticmethod
166+
def get_rsp_name(response: Response, is_good: bool = False) -> list:
165167
"""
166168
获取响应的帖子名称
167169

0 commit comments

Comments
 (0)
Failed to load comments.