Browse Source

restrictions: Don't rely on role names, use role ids instead

main
Ave Ozkal 2 years ago
parent
commit
d863b1be28
4 changed files with 5 additions and 6 deletions
  1. +2
    -2
      README.md
  2. +1
    -1
      cogs/logs.py
  3. +2
    -2
      cogs/mod.py
  4. +0
    -1
      config.py.template

+ 2
- 2
README.md View File

@ -68,13 +68,13 @@ Main goal of this project is to get Robocop functionality done, secondary goal i
- [x] Better security, better checks and better guild whitelisting
- [ ] New verification feature: Using log module from akbbot for logging attempts and removing old attempts
- [ ] New moderation feature: mutetime (mute with time)
- [ ] New moderation feature: watch-unwatch (using log module from akbbot)
- [ ] New feature: Highlights (problematic words automatically get posted to modmail channel)
- [ ] New feature: Modmail
- [ ] New feature: Submiterr
- [ ] New moderation feature: Display of mutes on listwarns
- [ ] New moderation feature: User notes
- [ ] New moderation feature: watch-unwatch (using log module from akbbot)
- [ ] New moderation feature: mutetime (mute with time)
- [ ] New moderation feature: timelock (channel lockdown with time)
- [x] New moderation feature: Reaction removing features (thanks misson20000!)
- [x] New moderation feature: User nickname change


+ 1
- 1
cogs/logs.py View File

@ -50,7 +50,7 @@ class Logs:
if str(member.id) in rsts:
roles = []
for rst in rsts[str(member.id)]:
roles.append(discord.utils.get(member.guild.roles, name=rst))
roles.append(discord.utils.get(member.guild.roles, id=rst))
await member.add_roles(*roles)
# Real hell zone.


+ 2
- 2
cogs/mod.py View File

@ -79,7 +79,7 @@ class Mod:
log_channel = self.bot.get_channel(config.log_channel)
await log_channel.send(chan_message)
await ctx.send(f"{target.mention} can no longer speak.")
await self.add_restriction(target, config.mute_role_name)
await self.add_restriction(target, config.mute_role)
@commands.guild_only()
@commands.bot_has_permissions(kick_members=True)
@ -99,7 +99,7 @@ class Mod:
log_channel = self.bot.get_channel(config.log_channel)
await log_channel.send(chan_message)
await ctx.send(f"{target.mention} can now speak again.")
await self.remove_restriction(target, config.mute_role_name)
await self.remove_restriction(target, config.mute_role)
@commands.guild_only()
@commands.bot_has_permissions(kick_members=True)


+ 0
- 1
config.py.template View File

@ -45,4 +45,3 @@ community_channels = [526378423468425236] # Channels requiring community role
general_channels = [526372255052201995] # Channels everyone can access
mute_role = 526500080879140874 # Mute role in NotSwitched
mute_role_name = "muted" # Mute role name in NotSwitched

Loading…
Cancel
Save