@@ -413,16 +413,8 @@ async def plugins_remove(self, ctx, *, plugin_name: str):
413413 )
414414 await ctx .send (embed = embed )
415415
416- @plugins .command (name = "update" )
417- @checks .has_permissions (PermissionLevel .OWNER )
418- async def plugins_update (self , ctx , * , plugin_name : str ):
419- """
420- Update a plugin for the bot.
421-
422- `plugin_name` can be the name of the plugin found in `{prefix}plugin registry`, or a direct reference
423- to a GitHub hosted plugin (in the format `user/repo/name[@branch]`).
424- """
425-
416+ async def update_plugin (self , ctx , plugin_name ):
417+ logger .debug ("Updating %s." , plugin_name )
426418 plugin = await self .parse_user_input (ctx , plugin_name , check_version = True )
427419 if plugin is None :
428420 return
@@ -441,13 +433,31 @@ async def plugins_update(self, ctx, *, plugin_name: str):
441433 except commands .ExtensionError :
442434 logger .warning ("Plugin unload fail." , exc_info = True )
443435 await self .load_plugin (plugin )
444-
436+ logger . debug ( "Updated %s." , plugin_name )
445437 embed = discord .Embed (
446438 description = f"Successfully updated { plugin .name } ." ,
447439 color = self .bot .main_color ,
448440 )
449441 return await ctx .send (embed = embed )
450442
443+ @plugins .command (name = "update" )
444+ @checks .has_permissions (PermissionLevel .OWNER )
445+ async def plugins_update (self , ctx , * , plugin_name : str = None ):
446+ """
447+ Update a plugin for the bot.
448+
449+ `plugin_name` can be the name of the plugin found in `{prefix}plugin registry`, or a direct reference
450+ to a GitHub hosted plugin (in the format `user/repo/name[@branch]`).
451+
452+ To update all plugins, do `{prefix}plugins update`.
453+ """
454+
455+ if plugin_name is None :
456+ for plugin_name in self .bot .config ["plugins" ]:
457+ await self .update_plugin (ctx , plugin_name )
458+ else :
459+ await self .update_plugin (ctx , plugin_name )
460+
451461 @plugins .command (name = "loaded" , aliases = ["enabled" , "installed" ])
452462 @checks .has_permissions (PermissionLevel .OWNER )
453463 async def plugins_loaded (self , ctx ):
0 commit comments