forked from viveksantayana/geas-bot
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:
@ -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))
|
Reference in New Issue
Block a user