From 8a89721dfa32563b1270f635adee0a422201c629 Mon Sep 17 00:00:00 2001 From: omg-xtao <100690902+omg-xtao@users.noreply.github.com> Date: Tue, 28 Feb 2023 22:25:05 +0800 Subject: [PATCH] :bug: Fix TypeError in birthday plugin --- plugins/genshin/birthday.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/genshin/birthday.py b/plugins/genshin/birthday.py index 4ecdac12..c4e04def 100644 --- a/plugins/genshin/birthday.py +++ b/plugins/genshin/birthday.py @@ -1,6 +1,6 @@ import re from datetime import datetime -from typing import List +from typing import List, Optional from genshin import Client, GenshinException 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) @staticmethod - def role_to_id(name: str) -> int | None: + def role_to_id(name: str) -> Optional[int]: if name == "派蒙": return -1 return roleToId(name)