Esempio n. 1
0
    def purge_theme_songs():
        themes = SoundeffectsLibrary.fetch_theme_songs()

        to_delete = []
        for cmd in Command.db().all():
            name = cmd["name"]
            if name in themes:

                print(f"ILLEGAL COMMAND: {name}")
                command = Command(name)
                illegal_users = command.users()
                for user in illegal_users:
                    command.unallow_user(user)
                to_delete.append(cmd.doc_id)
        Command.delete(to_delete)
Esempio n. 2
0
 def __init__(self, name, inital_cost=1):
     self.name = name
     self.permitted_users = []
     self.inital_health = 3
     self.inital_cost = inital_cost
     self.is_theme_song = self.name in SoundeffectsLibrary.fetch_theme_songs()