def reset_server_karma(self, guildId): with DB.atomic() as transaction: try: Karma.update(karma = 0).where(Karma.guild == guildId) \ .execute() except Exception as e: transaction.rollback() raise e return True
def restart_avaiable_karma(self): with DB.atomic() as transaction: try: Karma.update(avaiable_karma = DEFAULT_AVAIABLE_KARMA) \ .execute() except Exception as e: transaction.rollback() raise e return True