File tree Expand file tree Collapse file tree 1 file changed +12
-4
lines changed
Expand file tree Collapse file tree 1 file changed +12
-4
lines changed Original file line number Diff line number Diff line change @@ -329,14 +329,22 @@ async def list(self, ctx: discord.ApplicationContext):
329329 master_list [counter ].append (embed )
330330
331331 # Send all embeds using followup messages
332- for i , page_list in enumerate (master_list ):
333- if page_list : # Only send if there are embeds
334- await ctx .followup .send (embeds = page_list )
332+ try :
333+ for i , page_list in enumerate (master_list ):
334+ if page_list : # Only send if there are embeds
335+ try :
336+ await ctx .followup .send (embeds = page_list )
337+ except discord .NotFound :
338+ logger .error ("Interaction no longer valid" )
339+ break
340+ except Exception as e :
341+ logger .error (f"Error sending embed batch { i } : { str (e )} " )
342+ logger .error (traceback .format_exc ())
343+ break
335344
336345 except Exception as e :
337346 logger .error (f"Error in list command: { str (e )} " )
338347 logger .error (traceback .format_exc ())
339- await ctx .followup .send (f"Error listing drafts: { str (e )} " )
340348
341349 @discord .slash_command (name = 'debug' , description = 'Intended for bot developers only' )
342350 @commands .has_role (1159901879417974795 )
You can’t perform that action at this time.
0 commit comments