diff --git a/personalchannels/core.py b/personalchannels/core.py index 83255c5c..6f45371b 100644 --- a/personalchannels/core.py +++ b/personalchannels/core.py @@ -556,6 +556,9 @@ async def _pin(self, ctx: commands.Context, message: Optional[discord.Message] = channel = ctx.guild.get_channel(channel) await self.check_text_channels(ctx, channel) message = ref.resolved if (ref := ctx.message.reference) else message # type: ignore + if message is None: + await ctx.send("`Message` is a required argument.") + return if message.channel is not channel: await ctx.send(f"This is not your personal channel. (Your channel: {channel.mention})") return @@ -580,6 +583,9 @@ async def _unpin(self, ctx: commands.Context, message: Optional[discord.Message] channel = ctx.guild.get_channel(channel) await self.check_text_channels(ctx, channel) message = ref.resolved if (ref := ctx.message.reference) else message # type: ignore + if message is None: + await ctx.send("`Message` is a required argument.") + return if message.channel is not channel: await ctx.send(f"This is not your personal channel. (Your channel: {channel.mention})") return