File tree Expand file tree Collapse file tree 1 file changed +7
-4
lines changed
Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -606,13 +606,16 @@ async def sfw(self, ctx):
606606 @checks .thread_only ()
607607 async def msglink (self , ctx , message_id : int ):
608608 """Retrieves the link to a message in the current thread."""
609- message = await ctx .thread .recipient .fetch_message (message_id )
610- if not message :
609+ try :
610+ message = await ctx .thread .recipient .fetch_message (message_id )
611+ except discord .NotFound :
611612 embed = discord .Embed (
612- color = self .bot .main_color , description = "Message no longer exists."
613+ color = self .bot .error_color , description = "Message not found or no longer exists."
613614 )
614615 else :
615- embed = discord .Embed (color = self .bot .main_color , description = message .jump_url )
616+ embed = discord .Embed (
617+ color = self .bot .main_color , description = message .jump_url
618+ )
616619 await ctx .send (embed = embed )
617620
618621 @commands .command ()
You can’t perform that action at this time.
0 commit comments