Add settings view commands (#4041)

Any group which sent help + settings views has had the settings view
  split into a seperate command. This ensures that custom help behavior
  does not interfere with settings views.
This commit is contained in:
Michael H
2020-07-06 18:53:41 -04:00
committed by GitHub
parent 2cf7a1f80d
commit 60df447550
6 changed files with 200 additions and 177 deletions

View File

@@ -224,13 +224,15 @@ class Permissions(commands.Cog):
@permissions.group(name="acl", aliases=["yaml"])
async def permissions_acl(self, ctx: commands.Context):
"""Manage permissions with YAML files."""
if ctx.invoked_subcommand is None or ctx.invoked_subcommand == self.permissions_acl:
# Send a little guide on YAML formatting
await ctx.send(
_("Example YAML for setting rules:\n")
+ box(
textwrap.dedent(
"""\
@permissions_acl.command(name="yamlexample")
async def permissions_acl_yaml_example(self, ctx: commands.Context):
"""Sends an example of the yaml layout for permissions"""
await ctx.send(
_("Example YAML for setting rules:\n")
+ box(
textwrap.dedent(
"""\
COMMAND:
ping:
12345678901234567: true
@@ -241,10 +243,10 @@ class Permissions(commands.Cog):
12345678901234567: false
default: false
"""
),
lang="yaml",
)
),
lang="yaml",
)
)
@checks.is_owner()
@permissions_acl.command(name="setglobal")