Some small group command adjustments
This commit is contained in:
7
bot.py
7
bot.py
@@ -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))
|
await fail_category("archive", config_get("groups-archive-category", guild.id))
|
||||||
return
|
return
|
||||||
await groups[arg].edit(reason="Archive group " + arg, category=archive_cat)
|
await groups[arg].edit(reason="Archive group " + arg, category=archive_cat)
|
||||||
|
await ctx.send("Group " + arg + " archived.")
|
||||||
|
|
||||||
else:
|
else:
|
||||||
await ctx.send("Can't find that group!")
|
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)
|
active_groups = collect_group_channels(groups_cat)
|
||||||
archive_groups = collect_group_channels(archive_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:
|
if role is not None:
|
||||||
await role.delete(reason="Delete group " + arg)
|
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)
|
await active_groups[arg].delete(reason="Delete group " + arg)
|
||||||
if arg in archive_groups:
|
if arg in archive_groups:
|
||||||
await archive_groups[arg].delete(reason="Delete group " + arg)
|
await archive_groups[arg].delete(reason="Delete group " + arg)
|
||||||
|
|
||||||
|
await ctx.send("Group " + arg + " deleted.")
|
||||||
elif subcommand == 'create':
|
elif subcommand == 'create':
|
||||||
if arg is None:
|
if arg is None:
|
||||||
await ctx.send("Group name required!")
|
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 member.add_roles(role, reason="Create group " + arg)
|
||||||
await asyncio.sleep(5)
|
await asyncio.sleep(5)
|
||||||
await channel.send("Hi, " + role.mention)
|
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:
|
def _is_message_valid_for_selection(message: discord.Message, reaction_filter: Optional[str] = None) -> bool:
|
||||||
|
|||||||
Reference in New Issue
Block a user