Pārlūkot izejas kodu

added auto removal of deleted roles from the self assign roles. Starting to move the managment of data by the cogs into the cogs. And then making settings be something the cogs plug into.

tags/v2.0.0
Roxie Gibson pirms 5 gadiem
vecāks
revīzija
89d2edbd6d
1 mainītis faili ar 8 papildinājumiem un 0 dzēšanām
  1. +8
    -0
      roxbot/cogs/selfassign.py

+ 8
- 0
roxbot/cogs/selfassign.py Parādīt failu

@@ -36,6 +36,14 @@ class SelfAssign():
def __init__(self, Bot):
self.bot = Bot

async def on_guild_role_delete(self, role):
settings = gs.get(role.guild)
sa = settings.self_assign
for sa_role in sa["roles"]:
if int(sa_role) == role.id:
sa["roles"].remove(role.id)
return settings.update(sa, "self_assign")

@commands.command(pass_context=True)
async def listroles(self, ctx):
"""

Notiek ielāde…
Atcelt
Saglabāt