🐛 Fix TypeError in birthday plugin

This commit is contained in:
omg-xtao 2023-02-28 22:25:05 +08:00 committed by GitHub
parent 18d2590374
commit 8a89721dfa
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1,6 +1,6 @@
import re import re
from datetime import datetime from datetime import datetime
from typing import List from typing import List, Optional
from genshin import Client, GenshinException from genshin import Client, GenshinException
from genshin.client.routes import Route from genshin.client.routes import Route
@ -139,7 +139,7 @@ class BirthdayPlugin(Plugin, BasePlugin):
await client.cookie_manager.request(url, method="POST", params=params, json=json) await client.cookie_manager.request(url, method="POST", params=params, json=json)
@staticmethod @staticmethod
def role_to_id(name: str) -> int | None: def role_to_id(name: str) -> Optional[int]:
if name == "派蒙": if name == "派蒙":
return -1 return -1
return roleToId(name) return roleToId(name)