Some small group command adjustments

This commit is contained in:
2021-03-12 16:44:29 +01:00
parent 56831dcc69
commit 4c45ed808c

7
bot.py
View File

@@ -413,6 +413,7 @@ async def group_command(ctx: commands.Context, subcommand: Optional[str], arg: O
await fail_category("archive", config_get("groups-archive-category", guild.id))
return
await groups[arg].edit(reason="Archive group " + arg, category=archive_cat)
await ctx.send("Group " + arg + " archived.")
else:
await ctx.send("Can't find that group!")
@@ -430,7 +431,7 @@ async def group_command(ctx: commands.Context, subcommand: Optional[str], arg: O
active_groups = collect_group_channels(groups_cat)
archive_groups = collect_group_channels(archive_cat)
role = guild.get_role(config_get("groups-role-prefix", guild.id))
role = guild.get_role(config_get("groups-role-prefix", guild.id) + arg)
if role is not None:
await role.delete(reason="Delete group " + arg)
@@ -438,6 +439,8 @@ async def group_command(ctx: commands.Context, subcommand: Optional[str], arg: O
await active_groups[arg].delete(reason="Delete group " + arg)
if arg in archive_groups:
await archive_groups[arg].delete(reason="Delete group " + arg)
await ctx.send("Group " + arg + " deleted.")
elif subcommand == 'create':
if arg is None:
await ctx.send("Group name required!")
@@ -458,7 +461,7 @@ async def group_command(ctx: commands.Context, subcommand: Optional[str], arg: O
await member.add_roles(role, reason="Create group " + arg)
await asyncio.sleep(5)
await channel.send("Hi, " + role.mention)
await ctx.send("Done :)")
await ctx.send("Group " + arg + " created.")
def _is_message_valid_for_selection(message: discord.Message, reaction_filter: Optional[str] = None) -> bool: