embedset - fix perm check for subcommands, add missing return (#4962)

This commit is contained in:
bobloy 2021-05-19 06:19:28 -04:00 committed by GitHub
parent c83eae931b
commit 75ce67837a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1268,7 +1268,7 @@ class Core(commands.commands._RuleDropper, commands.Cog, CoreLogic):
def _check_if_command_requires_embed_links(self, command_obj: commands.Command) -> None: def _check_if_command_requires_embed_links(self, command_obj: commands.Command) -> None:
for command in itertools.chain((command_obj,), command_obj.parents): for command in itertools.chain((command_obj,), command_obj.parents):
if command_obj.requires.bot_perms.embed_links: if command.requires.bot_perms.embed_links:
# a slight abuse of this exception to save myself two lines later... # a slight abuse of this exception to save myself two lines later...
raise commands.UserFeedbackCheckFailure( raise commands.UserFeedbackCheckFailure(
_( _(
@ -1434,6 +1434,7 @@ class Core(commands.commands._RuleDropper, commands.Cog, CoreLogic):
if enabled is None: if enabled is None:
await self.bot._config.user(ctx.author).embeds.clear() await self.bot._config.user(ctx.author).embeds.clear()
await ctx.send(_("Embeds will now fall back to the global setting.")) await ctx.send(_("Embeds will now fall back to the global setting."))
return
await self.bot._config.user(ctx.author).embeds.set(enabled) await self.bot._config.user(ctx.author).embeds.set(enabled)
await ctx.send( await ctx.send(