Skip to content

Commit 55909cd

Browse files
committed
Remove source_channel as an argument and set ctx.channel as the current permanent source_channel
1 parent faba64e commit 55909cd

1 file changed

Lines changed: 1 addition & 9 deletions

File tree

bot/exts/utils/tunnel.py

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -38,22 +38,14 @@ async def tunnel(
3838
self,
3939
ctx: commands.Context,
4040
destination_channel: discord.TextChannel | None,
41-
source_channel: discord.TextChannel | None,
4241
) -> None:
4342
"""Creates a tunnel."""
4443
if destination_channel is None:
4544
least_active_channel_id = self.get_least_active_channel_id(ctx.channel.id)
4645
least_active_channel = await ctx.guild.fetch_channel(least_active_channel_id)
4746
destination_channel = least_active_channel
4847

49-
if source_channel is None:
50-
if not isinstance(ctx.channel, discord.TextChannel):
51-
raise BadArgument(
52-
f"The current channel of type '{ctx.channel.type}' is not a valid source channel "
53-
"and no explicit source channel was provided"
54-
)
55-
56-
source_channel = ctx.channel
48+
source_channel = ctx.channel
5749

5850
if not source_channel.permissions_for(ctx.author).send_messages:
5951
raise BadArgument(f"You don't have permission to send messages in {source_channel.jump_url}")

0 commit comments

Comments
 (0)