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

@@ -2,7 +2,7 @@ import logging
from logging import Logger
from os import makedirs
from pathlib import Path
from typing import Union, List, Dict, Any
from typing import List, Dict, Any
from uuid import uuid4
from discord import ApplicationContext, Embed, File, option, Role, TextChannel
@@ -54,10 +54,10 @@ class Data(commands.Cog):
)
)
mod_role: Union[Role, None] = ds_utils.get(
mod_role: Role | None = ds_utils.get(
ctx.user.guild.roles, id=await config_get("moderators", "roles")
)
admin_chan: Union[TextChannel, None] = ds_utils.get(
admin_chan: TextChannel | None = ds_utils.get(
ctx.user.guild.channels,
id=await config_get("adminchat", "channels", "text"),
)
@@ -126,10 +126,10 @@ class Data(commands.Cog):
)
)
mod_role: Union[Role, None] = ds_utils.get(
mod_role: Role | None = ds_utils.get(
ctx.user.guild.roles, id=await config_get("moderators", "roles")
)
admin_chan: Union[TextChannel, None] = ds_utils.get(
admin_chan: TextChannel | None = ds_utils.get(
ctx.user.guild.channels,
id=await config_get("adminchat", "channels", "text"),
)