@@ -413,16 +413,8 @@ async def plugins_remove(self, ctx, *, plugin_name: str):
413
413
)
414
414
await ctx .send (embed = embed )
415
415
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 )
426
418
plugin = await self .parse_user_input (ctx , plugin_name , check_version = True )
427
419
if plugin is None :
428
420
return
@@ -441,13 +433,31 @@ async def plugins_update(self, ctx, *, plugin_name: str):
441
433
except commands .ExtensionError :
442
434
logger .warning ("Plugin unload fail." , exc_info = True )
443
435
await self .load_plugin (plugin )
444
-
436
+ logger . debug ( "Updated %s." , plugin_name )
445
437
embed = discord .Embed (
446
438
description = f"Successfully updated { plugin .name } ." ,
447
439
color = self .bot .main_color ,
448
440
)
449
441
return await ctx .send (embed = embed )
450
442
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
+
451
461
@plugins .command (name = "loaded" , aliases = ["enabled" , "installed" ])
452
462
@checks .has_permissions (PermissionLevel .OWNER )
453
463
async def plugins_loaded (self , ctx ):
0 commit comments