Finished the bot. Requires testing.

Wrote up documentation. Readme needs finishing.
Future development needs to use global listeners for processes.
This commit is contained in:
2021-07-23 15:55:27 +01:00
parent 2f974f9f8f
commit 5bb9af12c9
9 changed files with 334 additions and 81 deletions

View File

@ -373,39 +373,34 @@ class Configuration(commands.Cog, name='Configuration Commands'):
loadCog(f'./{cogsDir}/slashcommands/secondary/edit_membership.py')
await self.client.slash.sync_all_commands()
@cog_ext.cog_slash(
name='test',
description='testing options',
@cog_ext.cog_subcommand(
base='config',
# subcommand_group='notifications',
name='restrict',
description='Toggle membership estriction for the guild.',
# base_description='Commands for configuring the various parameters of the Guild',
# base_default_permission=False,
# base_permissions=permissions,
# subcommand_group_description='Configures whether the bot monitors and responds to posts in key channels.',
guild_ids=guild_ids,
options=[
create_option(
name='required',
description='This option is mandatory',
option_type=3,
name='value',
description='Enable membership restrictions for the guild?',
option_type=5,
required=True
),
create_option(
name='not_required',
description='This option is not mandatory',
option_type=3,
required=False
),
create_option(
name='optional',
description='This option is optional',
option_type=3,
required=False
)
]
)
async def _test(
async def _restrict(
self,
ctx:SlashContext,
required:str,
not_required:str=None,
optional:str=None
value:bool
):
await ctx.send(f'```You entered: name = {required}, not_required = {not_required}, and optional = {optional}```',hidden=True)
conf = yaml_load(configFile)
conf[str(ctx.guild.id)]['restrict'] = value
yaml_dump(conf, configFile)
await ctx.send(f'```Membership restrictions for the guild `{ctx.guild.name}` have been set to `{value}`.```',hidden=True)
def setup(client):
client.add_cog(Configuration(client))