Skip to content

Commit 39462ce

Browse files
Jerrie-Arieskhakers
authored andcommitted
Fix bug with ?plugin update. (modmail-dev#3295)
(cherry picked from commit a94e7a9) Signed-off-by: Khakers <22665282+khakers@users.noreply.github.com>
1 parent f86b674 commit 39462ce

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,7 @@ however, insignificant breaking changes do not guarantee a major version bump, s
8181
- Fixed blocked roles improperly saving in `blocked_users` config.
8282
- Fixed `?block` command improperly parsing reason as timestamp.
8383
- Rate limit issue when fetch the messages due to reaction linking. ([PR #3306](https://github.com/modmail-dev/Modmail/pull/3306))
84+
- Update command fails when the plugin is invalid. ([PR #3295](https://github.com/modmail-dev/Modmail/pull/3295))
8485

8586
### Internal
8687
- `ConfigManager.get` no longer accepts two positional arguments: the `convert` argument is now keyword-only.

cogs/plugins.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -499,12 +499,12 @@ async def update_plugin(self, ctx, plugin_name):
499499
description=f"Failed to update {plugin.name}. This plugin will now be removed from your bot.",
500500
color=self.bot.error_color,
501501
)
502-
self.bot.config["plugins"].remove(plugin_name)
503-
logger.debug("Failed to update %s. Removed plugin from config.", plugin_name)
502+
self.bot.config["plugins"].remove(str(plugin))
503+
logger.debug("Failed to update %s. Removed plugin from config.", plugin)
504504
else:
505-
logger.debug("Updated %s.", plugin_name)
505+
logger.debug("Updated %s.", plugin)
506506
else:
507-
logger.debug("Updated %s.", plugin_name)
507+
logger.debug("Updated %s.", plugin)
508508
return await ctx.send(embed=embed)
509509

510510
@plugins.command(name="update")

0 commit comments

Comments
 (0)