Replaced legacy Union[] with new syntax
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import logging
|
||||
from typing import Any, Dict, Union
|
||||
from typing import Any, Dict
|
||||
|
||||
from discord import ApplicationContext, Embed, option, TextChannel, Role
|
||||
from discord import utils as ds_utils
|
||||
@@ -108,9 +108,7 @@ class CustomChannels(commands.Cog):
|
||||
bots: Dict[str, Any] = await config_get("bots")
|
||||
|
||||
for bot in bots:
|
||||
role: Union[Role, None] = ds_utils.get(
|
||||
ctx.user.guild.roles, id=bots[bot]["role"]
|
||||
)
|
||||
role: Role | None = ds_utils.get(ctx.user.guild.roles, id=bots[bot]["role"])
|
||||
|
||||
if role is not None:
|
||||
await created_channel.set_permissions(
|
||||
@@ -131,7 +129,7 @@ class CustomChannels(commands.Cog):
|
||||
) -> None:
|
||||
holo_user_ctx: HoloUser = HoloUser(ctx.user)
|
||||
|
||||
custom_channel: Union[TextChannel, None] = ds_utils.get(
|
||||
custom_channel: TextChannel | None = ds_utils.get(
|
||||
ctx.guild.channels, id=holo_user_ctx.customchannel
|
||||
)
|
||||
|
||||
@@ -188,7 +186,7 @@ class CustomChannels(commands.Cog):
|
||||
|
||||
await ctx.defer()
|
||||
|
||||
custom_channel: Union[TextChannel, None] = ds_utils.get(
|
||||
custom_channel: TextChannel | None = ds_utils.get(
|
||||
ctx.guild.channels, id=holo_user_ctx.customchannel
|
||||
)
|
||||
|
||||
|
Reference in New Issue
Block a user