diff --git a/example.env b/example.env index d7ef59b..248b1d6 100644 --- a/example.env +++ b/example.env @@ -1,2 +1,2 @@ -DISCORD_TOKEN=BLAHBLAH +DISCORD_TOKEN= DISCORD_GUILD_ID= diff --git a/src/commands/join.py b/src/commands/join.py index 8442c28..0db50d2 100644 --- a/src/commands/join.py +++ b/src/commands/join.py @@ -18,7 +18,7 @@ @discord.app_commands.command( # type:ignore[arg-type] name='join', - description='Join a team using a password', + description='Use your password to join the server under your team', ) @app_commands.describe( password="Your team's password", @@ -28,12 +28,12 @@ async def join(interaction: discord.Interaction["BotClient"], password: str) -> if member is None or isinstance(member, discord.User): return - if interaction.guild is None or not isinstance(interaction.channel, discord.TextChannel): - return - guild: discord.Guild = interaction.guild - - channel: discord.TextChannel = interaction.channel - if channel is None or not channel.name.startswith(CHANNEL_PREFIX): + guild: discord.Guild | None = interaction.guild + channel: discord.interactions.InteractionChannel | None = interaction.channel + if (guild is None + or not isinstance(channel, discord.TextChannel) + or channel is None + or not channel.name.startswith(CHANNEL_PREFIX)): return chosen_team = await find_team(interaction.client, member, password)