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,6 +1,5 @@
import logging
import sys
from typing import Union
from discord import (
ApplicationContext,
@@ -160,10 +159,10 @@ class Admin(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"),
)
@@ -216,10 +215,10 @@ class Admin(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"),
)