Skip to content

Commit 2b501cd

Browse files
committed
Improve If-Statement readability
Fixes the readability of the if statements (combined together with and condition)
1 parent 49f3e56 commit 2b501cd

1 file changed

Lines changed: 8 additions & 9 deletions

File tree

cogs/plugins.py

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -326,15 +326,14 @@ async def parse_user_input(self, ctx, plugin_name, check_version=False, check_re
326326
plugin = Plugin(user, repo, plugin_name, branch)
327327

328328
else:
329-
if check_registry:
330-
if self.bot.config.get("registry_plugins_only"):
331-
embed = discord.Embed(
332-
description="This plugin is not in the registry. To install this plugin, "
333-
"you must set `REGISTRY_PLUGINS_ONLY=no` or remove this key in your .env file.",
334-
color=self.bot.error_color,
335-
)
336-
await ctx.send(embed=embed)
337-
return
329+
if check_registry and self.bot.config.get("registry_plugins_only"):
330+
embed = discord.Embed(
331+
description="This plugin is not in the registry. To install this plugin, "
332+
"you must set `REGISTRY_PLUGINS_ONLY=no` or remove this key in your .env file.",
333+
color=self.bot.error_color,
334+
)
335+
await ctx.send(embed=embed)
336+
return
338337
try:
339338
plugin = Plugin.from_string(plugin_name)
340339
except InvalidPluginError:

0 commit comments

Comments
 (0)