Removed legacy usage of Union[]

This commit is contained in:
2024-12-26 18:36:57 +01:00
parent 95d04308bd
commit aa2c778a6a
13 changed files with 128 additions and 149 deletions

View File

@@ -1,6 +1,6 @@
import logging
from pathlib import Path
from typing import Any, Dict, Union
from typing import Any, Dict
from typing_extensions import override
@@ -26,10 +26,10 @@ class PycordBot(Bot):
def __init__(
self,
*args,
config: Union[Dict[str, Any], None] = None,
config_path: Union[str, Path] = Path("config.json"),
locales_root: Union[str, Path, None] = None,
scheduler: Union[AsyncIOScheduler, BackgroundScheduler, None] = None,
config: Dict[str, Any] | None = None,
config_path: str | Path = Path("config.json"),
locales_root: str | Path | None = None,
scheduler: AsyncIOScheduler | BackgroundScheduler | None = None,
**kwargs,
):
if config is None:
@@ -56,7 +56,7 @@ class PycordBot(Bot):
self.in_all_locales = self.bot_locale.in_all_locales
self.in_every_locale = self.bot_locale.in_every_locale
self.scheduler: Union[AsyncIOScheduler, BackgroundScheduler, None] = scheduler
self.scheduler: AsyncIOScheduler | BackgroundScheduler | None = scheduler
@override
async def start(self, token: str, reconnect: bool = True, scheduler_start: bool = True) -> None: