Exemple #1
0
    def set_recent_score_channel_id(self, db_guild, channel_id):
        db_guild.recent_scores_channel_id = channel_id

        self._db.commit_changes()
        Logger.log(db_guild, f"Updated recent scores channel to {channel_id}")
Exemple #2
0
    def add_player(self, db_guild, db_player):
        db_guild.players.append(db_player)

        self._db.commit_changes()
        Logger.log(db_guild, f"Added {db_player}")
Exemple #3
0
 def add_entry(self, entry):
     self.session.add(entry)
     Logger.log(entry, "Added")
     self.commit_changes()
Exemple #4
0
 def add_entries(self, entries):
     self.session.add_all(entries)
     Logger.log(type(entries[0]), f"Added {len(entries)} new entries")
     self.commit_changes()
Exemple #5
0
    def add_to_guild(self, db_player, db_guild):
        db_player.guilds.append(db_guild)

        self._db.commit_changes()
        Logger.log(db_player, f"Added {db_guild}")
Exemple #6
0
    def remove_guild(self, db_player, db_guild):
        db_player.guilds.remove(db_guild)

        self._db.commit_changes()
        Logger.log(db_player, f"Removed {db_guild}")
Exemple #7
0
    def remove_role(self, db_player, db_role):
        db_player.roles.remove(db_role)

        self._db.commit_changes()
        Logger.log(db_player, f"Removed {db_role}")
Exemple #8
0
    def add_role(self, db_player, db_role):
        db_player.roles.append(db_role)

        self._db.commit_changes()
        Logger.log(db_player, f"Added {db_role}")
Exemple #9
0
    def remove_player(self, db_player):
        self._db.session.delete(db_player)

        self._db.commit_changes()
        Logger.log(db_player, "Deleted")