Replaced legacy Union[] with new syntax

This commit is contained in:
2024-12-27 00:18:54 +01:00
parent 7b64f6938b
commit eed084cd91
6 changed files with 31 additions and 42 deletions

View File

@@ -1,4 +1,4 @@
from typing import Dict, Any, Union
from typing import Dict, Any
from discord import Member, Message, TextChannel
from discord import utils as ds_utils
@@ -33,11 +33,11 @@ class Logger(commands.Cog):
@commands.Cog.listener()
async def on_member_join(self, member: Member) -> None:
welcome_chan: Union[TextChannel, None] = ds_utils.get(
welcome_chan: TextChannel | None = ds_utils.get(
self.client.get_guild(await config_get("guild")).channels,
id=await config_get("welcome", "channels", "text"),
)
rules_chan: Union[TextChannel, None] = ds_utils.get(
rules_chan: TextChannel | None = ds_utils.get(
self.client.get_guild(await config_get("guild")).channels,
id=await config_get("rules", "channels", "text"),
)