Approve/revoke: added
This commit is contained in:
parent
785ea868da
commit
5fc612710c
2 changed files with 37 additions and 1 deletions
|
@ -23,7 +23,7 @@ Based on https://gitlab.com/ao/dpybotbase
|
|||
- [x] Moderation: silentban
|
||||
- [x] Moderation: kick
|
||||
- [x] Moderation: userinfo
|
||||
- [ ] Moderation: approve-revoke (community)
|
||||
- [x] Moderation: approve-revoke (community)
|
||||
- [ ] Moderation: addhacker-removehacker
|
||||
- [ ] Moderation: lock-soft-unlock (channel lockdown)
|
||||
- [ ] Moderation: timelock (channel lockdown with time)
|
||||
|
|
36
cogs/mod.py
36
cogs/mod.py
|
@ -138,6 +138,42 @@ class ModCog:
|
|||
f"color = {user.colour}\n"
|
||||
f"top_role = {role}\n")
|
||||
|
||||
@commands.guild_only()
|
||||
@commands.check(check_if_staff)
|
||||
@commands.command()
|
||||
async def approve(self, ctx):
|
||||
approval_list = ctx.message.mentions
|
||||
community_role = ctx.guild.get_role(config.community_role)
|
||||
for to_approve in approval_list:
|
||||
await to_approve.add_roles(community_role,
|
||||
reason=str(ctx.author))
|
||||
|
||||
await ctx.send(f"Approved {len(approval_list)} member(s).")
|
||||
log_channel = self.bot.get_channel(config.log_channel)
|
||||
|
||||
approved_mentions = [approved.mention for approved in approval_list]
|
||||
await log_channel.send(f"✅ Approved: {ctx.author.mention} approved"
|
||||
f" {len(approval_list)} members\n"
|
||||
f"{' '.join(approved_mentions)}") # HACK
|
||||
|
||||
@commands.guild_only()
|
||||
@commands.check(check_if_staff)
|
||||
@commands.command(aliases=["unapprove"])
|
||||
async def revoke(self, ctx):
|
||||
revoke_list = ctx.message.mentions
|
||||
community_role = ctx.guild.get_role(config.community_role)
|
||||
for to_revoke in revoke_list:
|
||||
await to_revoke.remove_roles(community_role,
|
||||
reason=str(ctx.author))
|
||||
|
||||
await ctx.send(f"Un-approved {len(revoke_list)} member(s).")
|
||||
log_channel = self.bot.get_channel(config.log_channel)
|
||||
|
||||
revoked_mentions = [revoked.mention for revoked in revoke_list]
|
||||
await log_channel.send(f"❌ Un-approved: {ctx.author.mention} approved"
|
||||
f" {len(revoke_list)} members\n"
|
||||
f"{' '.join(revoked_mentions)}") # HACK
|
||||
|
||||
@commands.guild_only()
|
||||
@commands.check(check_if_staff)
|
||||
@commands.command(aliases=["setplaying", "setgame"])
|
||||
|
|
Loading…
Reference in a new issue