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}")
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}")
def add_entry(self, entry): self.session.add(entry) Logger.log(entry, "Added") self.commit_changes()
def add_entries(self, entries): self.session.add_all(entries) Logger.log(type(entries[0]), f"Added {len(entries)} new entries") self.commit_changes()
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}")
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}")
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}")
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}")
def remove_player(self, db_player): self._db.session.delete(db_player) self._db.commit_changes() Logger.log(db_player, "Deleted")